package com.stockz.equity.scanner.screen;

import java.util.List;

import org.springframework.stereotype.Component;

import com.stockz.equity.model.Bar;

@Component
public class BullishBarScreen implements Screen<Object> {

	@Override
	public Object getConfiguration() {
		return null;
	}

	@Override
	public int getMandatorySpan() {
		return 3;
	}

	@Override
	public boolean isMatch(List<Bar> barList) {
		if(barList == null || barList.size() <= getMandatorySpan()){
			return false;
		}
		
		Bar current = barList.get(0);
		Bar previous = barList.get(1);
		
		if(current.getClose() >= current.getAveragePrice()
				&& current.getAveragePrice() >= current.getMid()
				&& current.getMid() > previous.getAveragePrice()
				&& current.getAveragePrice() > previous.getClose()
				&& current.getHigh() > previous.getHigh()
				//&& current.getLow() > previous.getLow()
				//&& current.getVolume() > previous.getVolume()
				//&& current.getAverageTradeSize() > previous.getAverageTradeSize()
				){
			return true;
		}
		
		return false;
	}

}